#include <iostream>
#include <string>

int gcd(int p, int q) {
  if (q == 0) return p;

  int r = p % q;
  return gcd(q, r);
}

int main(int argc, char** argv) {
  if (argc < 3) 
    exit(0);

  int p = std::stoi(argv[1]);
  int q = std::stoi(argv[2]);

  std::cout << "p: " << p << ", q: " << q << ", gcd: " << gcd(p, q) << std::endl;
  return 0;
}
